New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minting Handles For Datasets #3146
Conversation
@4tikhonov @janvanmansum |
@scolapasta is going to correspond with @jo-pol about this one. |
…w extends IdServiceBean, implemented as far as it used to be called
In the process of testing.
update
|
Should that be fixed? |
CreateDatasetCommand sets GlobalIdCreateTime if createIdentifier was successful for EZId. Subsequently UpdateDatasetCommand retries if GlobalIdCreateTime is missing. Why is this mechanism not implemented for DataCite? In both cases createIdentifier can fail. |
I pinged @sekmiller about these questions and he'll be working with @jo-pol on answering them. |
(cherry picked from commit c269368)
# Conflicts: # src/main/java/edu/harvard/iq/dataverse/engine/command/impl/DeaccessionDatasetVersionCommand.java
Summarizing what I said in our chat previously: The UpdateDatasetTargetURLCommand is triggered via the native API It is only something that an admin would use since it updates the Target URL at the DOI service provider. We used it on the deployment of 4.0 and also when we added more widget functionality in 4.2 or 4.3 since these resulted in a change to Dataverse's base URL |
With regard to the UpdatDatasetCommand not trying to register DataCite datasets. This is because DataCite does not allow for a reserved (non-public) identifier. On create of a DataCite dataset we get an identifier for the dataset, but we don't actually register it with DataCite until the dataset is published. It's at that time we will register it with DataCite. |
We should definitely fix the logger calls. Thanks for picking up on that. Also, with respect to mock/provoke exceptions: we do need to add more unit testing. There was some work done regarding the base testing of commands that I think was merged into develop recently. I will take a look at it and see if it will help with adding testing here. |
} catch (Exception e){ | ||
logger.log(Level.WARNING, "Exception while creating Identifier: " + e.getMessage(), e); | ||
} | ||
|
||
// Check return value to make sure registration succeeded | ||
if (doiProvider.equals("EZID") && doiRetString.contains(theDataset.getIdentifier())) { | ||
if (!idServiceBean.registerWhenPublished() && doiRetString.contains(theDataset.getIdentifier())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my intention to drop the check on the protocol
once implementation of the handle service bean is completed.
There is still DestroyDatasetCommand
calling ctxt.doiDataCite()
. The last DatasetCommand that is not agnostic about the configured bean by calling IdServiceBean.getBean(ctxt)
controlled with another property of an idServiceBean
. Don't yet know how that property should be named and what the value for both properties should be for handlenet. Even I'm not sure whether these properties should be hard-coded or configurable. I also remember Ben wanted a handle to point to some resource with some original meta data and additional provenance about why/when the dataset was destroyed and who requested/executed/approved the action.
Rediscovering the API I guess the interface should be renamed into IdRegistrationServiceBean
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Yes, please rename this using
PersistentIdRegistrationServiceBean
instead ofIdRegistrationServiceBean
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For the AbstractIdServiceBean, please add a
postDeleteCleanup
cleanup method that will be called by theDestroyDatasetCommand
.public void postDeleteCleanup(){ ...}
- Within the
AbstractIdServiceBean
,postDeleteCleanup
can be added as a method that does nothing. - For the DataCite implementation, override the
postDeleteCleanup
method and add the DataCite cleanup
public String getIdentifierForLookup(String protocol, String authority, String separator, String identifier) { | ||
logger.log(Level.FINE,"getIdentifierForLookup"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method seems the same to me for both EZId and Datacite and I suppose it should become the same for handlenet as well. If true we can pull this one up to the abstract service bean. Any future exception to the rule can still override.
- pulled up methods to AbstractIdServiceBean - implemented methods of HandleNetServiceBean that still threw a NotImplementedException and were called somewhere This is a squashed commit of https://github.com/DANS-KNAW-jp/dataverse/pull/1 alias https://github.com/DANS-KNAW-jp/dataverse/tree/DDN-184-handle-implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please make the strings "doi" and "EZID" into re-usable variables.
|
||
String generateYear(); | ||
|
||
String generateTimeString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what we can tell, the generateTimeString
method isn't actually used anywhere. I commented it out as of 354e624 and the app still compiles. Should we remove it?
String nonNullDefaultIfKeyNotFound = ""; | ||
String doiProvider = ctxt.settings().getValueForKey(SettingsServiceBean.Key.DoiProvider, nonNullDefaultIfKeyNotFound); | ||
|
||
if ("hdl".equals(protocol)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hard coding "hdl"
here can we make HANDLE_PROTOCOL_TAG
public and reference that instead? That way we can define "hdl"
just once.
@@ -236,7 +236,8 @@ public boolean isUniqueIdentifier(String userIdentifier, String protocol, String | |||
boolean u = em.createQuery(query).getResultList().size() == 0; | |||
String nonNullDefaultIfKeyNotFound = ""; | |||
String doiProvider = settingsService.getValueForKey(SettingsServiceBean.Key.DoiProvider, nonNullDefaultIfKeyNotFound); | |||
if (doiProvider.equals("EZID")) { | |||
if (protocol.equals("doi") && doiProvider.equals("EZID")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please make the strings "doi" and "EZID" into re-usable static variables.
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
public abstract class AbstractIdServiceBean implements IdServiceBean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the AbstractIdServiceBean
class! It's a great help!
} | ||
|
||
@Override | ||
public String generateYear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
generateYear
this method is not needed. e.g. methods likegetMetadataFromStudyForCreateIndicator
will be overwritten
@4tikhonov : Sorry, no time to test these requested changes by myself |
There's a related thread from this morning at https://groups.google.com/d/msg/dataverse-community/v6jgyewGqlI/ZYDnFfWqAgAJ |
Replaced by pull request #3800. Closing. |
Implementation of Minting Handles For Datasets, see BRD
Some refactoring makes the dataset commands classes agnostic which IdServiceBean is configured: DOIEZIDServiceBean, DOIDataciteServiceBean or HandlenetServiceBean. When an id is registered is hard coded per bean: upon creation for EZID, upon publishing for DataCite and Handlenet.
1. Related Issues
2. Pull Request Checklist
3. Review Checklist
After the pull request has been submitted, fill out this section.
… warnings